/*公共方法begin*/
//导航栏选中样式
var path = window.location.pathname.split('.')[0].split('/')[1];
console.log(path);
if(path != ''){
  $('.'+path).addClass('active');
}else {
  $('.index').addClass('active');
}
/*公共方法end*/


//ajax请求
function ajaxRequest(ajaxUrl,ajaxType){
    $.ajax({
       url:ajaxUrl,
       type:String(ajaxType),
        dataType:"json",
       success:function(data){
            console.log(data)
        },
        error: function(msg) {
            console.log(msg)
        }
    })
}
//退出登陆
$('.loginout').click(function(){
    $.ajax({
       url:"/logout.json",
       type:"delete",
        dataType:"json",
       success:function(data){
            location.href='/index?viewType=page&&currentPage=1'
        },
        error: function(msg) {
            console.log(msg)
        }
    })
})
